package java4hanshu;

import java.util.Scanner;

public class Q4_4_2 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Object[] arr = new Object[n];
		for (int j = 0; j < n; j++) {
			String str = sc.next();
			if (str.equals("c")) {
				arr[j] = new Computer();
			} else if (str.equals("d")) {
				arr[j] = new Double(sc.nextDouble());
			} else if (str.equals("i")) {
				arr[j] = new Integer(sc.nextInt());
			} else if (str.equals("s")) {
				arr[j] = new String(sc.next());
			} else {
				arr[j] = null;
			}

		}
		for (int k = n-1; k >= 0; k--) {
			if (arr[k] != null) {
				System.out.println(arr[k]);
			}

		}
		sc.close();
	}

}
